#pragma once

{{statement_global_h}}

{{ get_cls_h_includes(entity) }}
namespace {{ namespace_name }} {
{{ get_cls_h_classes(entity) }}
/// <summary>
/// {{ entity.name }}{{ get_comment(entity.ownedComment, "") }}
/// </summary>
class {{ statement_macro_export }}{{ entity.name }}{{ get_generations(entity) }} {

{% if is_element_child(entity) %}
public: // Constructors and destructors
    explicit {{ entity.name }}(const QString& umlType="uml::{{ entity.name }}");

{% endif %}
public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

{% if entity.ownedOperations|length > 0 %}
public: // Methods
{% for op in entity.ownedOperations %}
{% if has_op(op) %}
    /// <summary>
    /// {{ get_op_identity(op)}}{{ get_comment(op.ownedComment) }}
    /// </summary>
    {{ get_op_qualifier(op)}}{{ get_op_return_type(op) }} {{ get_op_identity(op) }}({{ get_op_params(op) }}){{ get_op_const(op)}}{{ get_op_virtual_def(op)}}{{ get_op_qualifier_post(op)}};

{% endif %}
{% endfor %}
{% endif %}
{% if entity.ownedAttributes|length > 0 %}
public: // Properties
{% for attr in entity.ownedAttributes %}
{% if get_attr_has_getter(attr) %}
    /// <summary>
    /// {{ get_attr_identity(attr) }} getter{{ get_comment(attr.ownedComment) }}
    /// </summary>
    {{ get_attr_type(attr, false, true) }} {{ get_attr_identity(attr) }}(){{ get_attr_getter_const(attr)}};

{% endif %}
{% if get_attr_has_setter(attr) %}
    /// <summary>
    /// {{ get_attr_identity(attr) }} setter{{ get_comment(attr.ownedComment) }}
    /// </summary>
    void {{ get_setter_name(get_attr_identity(attr)) }}({{ get_attr_type(attr, true) }} value);

{% endif %}
{% endfor %}
private: // Fields
{% for attr in entity.ownedAttributes %}
    /// <summary>
    /// {{ get_attr_identity(attr) }}{{ get_comment(attr.ownedComment) }}
    /// </summary>
{% if get_attr_is_primitive(attr) %}
    const static {{ get_attr_type(attr) }} {{ get_attr_identity(attr) }}_default_;
    {{ get_attr_type(attr) }} {{ get_attr_identity(attr) }}_= {{ get_attr_identity(attr) }}_default_;
{% else %}
    {{ get_attr_type(attr) }} {{ get_attr_identity(attr) }}_{{ get_attr_default(attr)}};
{% endif %}

{% endfor %}
{% endif %}
};

} // namespace {{ namespace_name }}
